package com.study.choosemaster;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

/**
 * Created By gtx on 2017/8/12/8:21
 */
public class Test {

    public static void main(String[] args) throws InterruptedException {

        List<MasterSelector> masterSelectors=new ArrayList<MasterSelector>();
        for (int i=0;i<10;i++){
            UserCenter userCenter = new UserCenter();
            userCenter.setMc_id(i);
            userCenter.setMc_name("mc_"+i);

            MasterSelector masterSelector=new MasterSelector(userCenter);
            masterSelectors.add(masterSelector);
            masterSelector.start();
            TimeUnit.MILLISECONDS.sleep(1000);
        }

    }
}
